A Proposal for Coroutines and Suspend / Resume in E -

نویسندگان

  • Hubert Garavel
  • Mihaela Sighireanu
چکیده

The importance of coroutines as a programming paradigm is recognized. This paper proposes to extend LOTOS with a coroutine operator, for which syntax, static semantics, and untimed semantics are provided. We show that this coroutine mechanism generalizes several other op-eratorrs, which exist in LOTOS or which have been proposed for E-LOTOS, including trap, suspend-resume, and hiding. 1 Comments about the existing core behaviour language At present, the deenition of E-Lotos, as provided by the Kansas City output document is far advanced. However, some issues remain unsolved, especially in the behaviour part: The deenition of the core behaviour language, as produced after the Kansas City meeting, has introduced a new class of objects, exceptions, which can be felt as \similar to gates, but diierent". Following the famous Occam razor principle, we must question ourselves about the need for having two concepts: gates and exceptions. If we only consider an \untimed semantics" point of view, it is clear that gates and exceptions are much the same concept, and that we could replace exceptions by gates everywhere without any problem. This approach advocated in GS96] brings simplicity, expressiveness and good algebraic properties. If we consider a \timed semantics" point of view, the major diierence between gates and exceptions is urgency. According to ET-LOTOS principles, urgency is only attached to hidden gates; visible gates are not urgent. This is not the case with exceptions, which are always urgent. We notice that this deenition of exceptions as urgent (although motivated by semantic \tricks") violates the ET-LOTOS principle stating that one cannot enforce urgency on visible events: from the outside of a system, we can observe visible, urgent exceptions, which is is not allowed for gates. If accepted, this design choice will have the following consequence. Practically, when designing a system in E-LOTOS, engineers will associate gates to non-urgent external events and exceptions

برای دانلود رایگان متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

A Proposal for Coroutines in E-LOTOS

This paper proposes a coroutine operator for E-Lotos. The syntax, the static semantics, and the dynamic semantics of the operator are provided. We show by several examples that the coroutine operator is adequate to express suspension and resuming. Moreover, it is more general and simpler than the suspend-resume operator.

متن کامل

Typing Coroutines

A coroutine is a programming construct between function and thread. It can be invoked like a function, but before it returns a value (if ever) it may suspend itself arbitrarily often to return intermediate results and then be resumed with new inputs. Unlike with preemptive threading, a coroutine does not run concurrently with the rest of the program, but rather takes control until it voluntaril...

متن کامل

Christian - Albrechts - Universität Kiel

1 A coroutine is a programming construct between function and thread. It behaves like a function that can suspend itself arbitrarily often to yield intermediate results and to get new inputs before returning a result. This facility makes coroutines suitable for implementing generator abstractions. Languages that support coroutines are often untyped or they use trivial types for coroutines. This...

متن کامل

A unified syntax for stackless and stackful coroutines

This paper proposes a unified syntax for stackless and stackful coroutines. The syntax is based on N4397.3 The most important features are: • first-class object that can be stored in variables or containers • introduction of new keyword resumable together with a lambda-like expression • symmetric transfer of execution control, e.g. suspend-by-call enables a richer set of control flows than asym...

متن کامل

Enabling Internet Suspend/Resume with Session Continuations

Mobile laptop users have grown accustomed to the “suspend/resume” model of computing, in which activity can be resumed precisely from the point at which it was suspended, despite arbitrary periods of inactivity. Unfortunately, today’s Internet hosts lack support for seamless operation of session-based network applications across periods of disconnectivity; hence, contemporary operating systems ...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 1996